using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

namespace XmlObjects
{
	public partial class StringPropertyItem : UserControl , IPropertyItem
	{
		private PropertyInfo propertyInfo;
		public StringPropertyItem(PropertyInfo propertyInfo, object theObject)
		{
			InitializeComponent();
			this.propertyInfo = propertyInfo;
			label_propertyName.Text = PropertyName;
			textBox_value.Text = (string) propertyInfo.GetValue(theObject, null);
		}

		public string PropertyName
		{
			get { return propertyInfo.Name; }
		}

		public Control GetControl()
		{
			return this;
		}

		public object GetValue()
		{
			return textBox_value.Text;
		}

		public PropertyInfo PropertyInfo
		{
			get { return propertyInfo; }
		}
	}
}
